import { FormSchema } from '/@/components/Form'
import { BasicColumn } from '/@/components/Table'

export const columns = (): BasicColumn[] => {
  return [
    {
      title: '科目',
      dataIndex: 'kmdm',
    },
    {
      title: '实际考生数',
      dataIndex: 'sjkssl',
      width: 120,
    },
    {
      title: '缺考考生数',
      dataIndex: 'qkkssl',
      width: 120,
    },
    {
      title: '总考生数',
      dataIndex: 'kszsl',
      width: 100,
    },
    {
      title: '已扫考生数',
      width: 120,
      dataIndex: 'ysks',
    },
    {
      title: '已阅考生数',
      width: 120,
      dataIndex: 'yyks',
    },
    {
      title: '小题数(1份)',
      dataIndex: 'yfxts',
      width: 120,
    },
    {
      title: '总小题数',
      dataIndex: 'zxts',
      width: 100,
    },
    {
      title: '已阅小题数',
      dataIndex: 'yyxts',
      width: 120,
      slots: { customRender: 'yyxts' },
    },
  ]
}

export const columnsTwo = (): BasicColumn[] => {
  return [
    {
      title: '科目',
      dataIndex: 'kmdm',
      width: 200,
    },
    {
      title: '实际考生数',
      dataIndex: 'sjkssl',
      width: 200,
    },
    {
      title: '缺考考生数',
      dataIndex: 'qkkssl',
      width: 200,
    },
    {
      title: '总考生数',
      dataIndex: 'kszsl',
      width: 200,
    },
    {
      title: '已扫考生数',
      width: 200,
      dataIndex: 'ysks',
    },
    {
      title: '已阅考生数',
      width: 200,
      dataIndex: 'yyks',
    },
  ]
}

export const formSchemas = (): FormSchema[] => {
  return [
    {
      field: 'kmdm',
      label: '科目代码',
      colProps: { span: 4 },
      component: 'Input',
      rulesMessageJoinLabel: true,
    },
    {
      field: 'sfyc',
      label: '是否异常',
      colProps: { span: 4 },
      component: 'Select',
      rulesMessageJoinLabel: true,
      componentProps: {
        options: [
          { label: '是', value: 'y' },
          { label: '否', value: 'n' },
        ],
      },
    },
  ]
}
